package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * 用户意向级别
 * */
public enum UserIntentionLevel implements CustomEnumType {

    LEVELA("levelA", "A级"),
    LEVELB("levelB", "B级"),
    LEVELC("levelC", "C级"),
    LEVELD("levelD", "D级"),
    LEVELE("levelE", "E级"),
    LEVELF("levelF", "F级"),;

    private UserIntentionLevel(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, UserIntentionLevel> map = new HashMap<>();
    static {
        for (UserIntentionLevel value : UserIntentionLevel.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static UserIntentionLevel fromValue(String value) {
        UserIntentionLevel ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + UserIntentionLevel.class + "." + value);
        }
    }

}